﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace StoreWeb.system.news
{
    public partial class adduser : System.Web.UI.Page
    {
        //BLL.Role role = new BLL.Role() ;
        BLL.DealersManage bll = new BLL.DealersManage();
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                bindData(hidwhere.Value);
            }
        }

        void bindData(string where)
        {
            Repeater1.DataSource = bll.GetList(where);
            Repeater1.DataBind();
        }
        protected void AspNetPager1_PageChanged(object src, EventArgs e)
        {
            bindData(hidwhere.Value);
        }

        protected void btnserach_Click(object sender, EventArgs e)
        {
            string[] proSub = Request.Form.GetValues("s_province");
            string pro1 = proSub[s_province.SelectedIndex];

            string[] proSub2 = Request.Form.GetValues("s_city");
            string pro2 = proSub2[s_city.SelectedIndex];

            string[] proSub3 = Request.Form.GetValues("s_county");
            string pro3 = proSub3[s_county.SelectedIndex];

            string where = " 1=1 ";
            //if (typelist.SelectedItem.Value != "")
            //{
            //    where += " and cInvCCode = '" + typelist.SelectedItem.Value + "'";
            //}
            if (name.Value != null && !string.IsNullOrEmpty(name.Value))
            {
                where += " and username like '%" + name.Value + "%'";
            }
            hidwhere.Value = where;
            bindData(hidwhere.Value);
        }

        
    }
}